@extends('admin.layout.layout')
@section('content')
    <div class="mws-panel grid_8">
        @if(count(session('info'))>0)
            <div class="mws-form-message warning">
                <ul>
                   {{session('info')}}
                </ul>
            </div>
        @endif
        <div class="mws-panel-header">
            <span><i class="icon-table"></i> 类型列表</span>
        </div>
        <div class="mws-panel-body no-padding">

            <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
                    <thead>
                    <tr role="row">
                        <th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:56px;
    " aria-sort="ascending" aria-label="Rendering engine:activate to sort column descending">分类id</th>
                        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:400px;" aria-label="Browser:activate to sort column ascending">类型</th>
                        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:17px;
    " aria-label="CSS grade:activate to sort column ascending">操作</th>
                    </tr>
                    </thead>

                    <tbody role="alert" aria-live="polite" aria-relevant="all">
                    @foreach($data as $v)
                    <tr class="odd">
                        <td >{{$v['type_id']}}</td>
                        <td >{{$v['type_name']}}</td>
                        <td >
                            <a href="/admin/attr/index/{{$v['type_id']}}"><lable style="color:black">属性列表</lable></a>&nbsp;&nbsp;&nbsp;
                            <a href="/admin/type/edit/{{$v['type_id']}}"><i style="color:black;font-size: 20px;" title="修改" class="icon-pencil-2"></i></a>&nbsp;&nbsp;&nbsp;
                            <a href="javascript:;"><i onclick="del({{$v['type_id']}})" style="color:black;font-size: 20px;" title="删除" class="icon-trash"></i></a>&nbsp;&nbsp;&nbsp;
                        </td>
                    </tr>
                    @endforeach
                    </tbody>
            </table>
            <script>
                function del(id){
                    $.get('/admin/type/delete'+id,function(data){
                        if(data.stutus==0){
                            location.href=location.href;
                        }
                    });
                }
            </script>
    @endsection
